<?php
/**
 * vim: et ts=4 sts=4 sw=4 fdm=marker
 *
 * 测试controller 
 *
 * @author	wang Penghai <china_php@hotmail.com>
 * @copyright 2008 5e6d Corporation.
 * @version   $Id: config.php 29 2009-03-10 14:30:18Z wph $
 */
pf_load::init('admin_class_admin');
class index_action extends pf_controller{
	protected $menu_obj=null;
	public function __construct()
	{
		parent::__construct();
		$this->menu_obj = pf_load::init('admin_model_sysmenu');
	}

	public function index()
	{
		//获取用户权限
		$access_prov = isset($_COOKIE['admin_prov'])?$_COOKIE['admin_prov']:'';
		$access_prov = explode(',', $access_prov);

		//加载功能菜单
		$sys_menu = $this->menu_obj->get_sysmenu_list('tree', $access_prov);
		if (false === $sys_menu )
		{
			die('no menu!');
		}
		//var_export($sys_menu);
		$this->assign('sys_menu', $sys_menu);
		$show = pf_request::get('show');
		if (empty($show))
		{
			$this->view('admin_admin_view_index');
		}
		if ($show === 'header')
		{
			//$this->assign('admin_name', admin::admin_name);
			$this->view('admin_admin_view_index.header');
		}

		if ($show === 'menu')
		{
			//加载功能菜单
			$this->view('admin_admin_view_index.menu');
		}
		if ($show === 'main')
		{
			$this->view('admin_admin_view_index.main');
		}
	}


}